<%@ page language="java" pageEncoding="UTF-8" buffer="16kb"%>
<%@ include file="/base.jsp"%>
<%@ include file="/module/taglibs.jsp"%>
<%@ include file="/module/nocache.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<%@ include file="/module/js.jsp"%>
<%@ include file="/module/orderField.jsp"%>

     <script type="text/javascript" src="${basePath}/js/jquery.Huploadify.js"></script>
     <link href="${basePath}/css/Huploadify.css" rel="stylesheet">
<style>

table label.error {
    margin-left: 5px;
    width: auto;
    display: inline;
    color: red;
}
</style>


</head>
<body>
     <form action="#" name="Form" id="Form" method="post">
        <input type="hidden" name="directoryId" id="directoryId"  value="${directoryId}"/> 
        <input type="hidden" name="projectId" id="projectId"  value="${projectId}"/> 
        <input type="hidden" name="level" id="level"  value="${level}"/> 
        <input type="hidden" name="projectMaterialId" id="projectMaterialId"  value="${data.projectMaterialId}"/>
		<table cellpadding="0" cellspacing="0" border="0" class="table-border" width="80%">
			<tr>
				<td class="table-header" colspan="4">材料管理</td>
			</tr>
			<tr>
				<td class="table-titleTD" style="width: 30%">主题：</td>
				<td class="table-contentTD" style="width: 70%">${data.title}</td>
			</tr>
			<tr>
				<td class="table-titleTD" style="width: 30%">时间：</td>
				<td class="table-contentTD" style="width: 70%">${data.date1}</td>
			</tr>
			
		    <tr>
			    <td class="table-titleTD" style="width: 30%">负责人：</td>
				<td class="table-contentTD" style="width: 70%">${data.xm}</td>	
		 	</tr>
		 	
		 	<tr>
		 	    <td class="table-titleTD" style="width: 30%">文件上交类型：</td>
				<td class="table-contentTD" style="width: 70%">
					<c:if test="${data.type==1}">上交</c:if>
					<c:if test="${data.type==2}">个人</c:if>
				</td>	
			</tr>
			<tr>
					 <td class="table-titleTD" style="width: 30%">附件：</td>
					 <td colspan="3">
					      <table>
					           <c:forEach items="${dataList}" var="projectMaterialFilepath" varStatus="index">
						           <tr>
					                    <td>
								            [文件] ${projectMaterialFilepath.filename}
								         </td>
								         <td>
								               <a href="${basePath}/DownLoadFileServlet?filename=${projectMaterialFilepath.filename}&filepath=${projectMaterialFilepath.filepath}">下载</a> 
				                          </td>
					                </tr>
						   	    </c:forEach>
						   </table>
					 </td>
			</tr>
			<tr>
				<td class="table-titleTD">备注：</td>
				<td class="table-contentTD" colspan="2">${data.remark}</td>
			</tr>
		</table>
		<br />
		<table cellpadding="1" cellspacing="1" border="0" align="left">
		
			<tr>
			     <c:if test="${data.state==0 or data.state==2}">
			    <kl:permission permisstionList="${permisstionList}" currentUser="${_login_console_user}" currentCatalogId="<%=CatalogUtils.getCatalogId(\"OF_ZLTS_CLGL\")%>" key="modify">	
			            <td><input type="button" id="butSubmit" class="inputButton" style="text-align: center;" value="提交" autocomplete="off"  /></td>
			            <td><input type="button" id="btnSave" class="inputButton" style="text-align: center;" value="修改" /></td>
			            </kl:permission>
				 </c:if>
				 <td><input type="button" id="returnBut"  class="inputButton" value="返回"  style="text-align: center;"/></td>
			</tr>
		</table>
		<script>
		 
			$(document).ready(function() {
				 $("#btnSave").click(function() {
					 window.location.href ="${basePath}/projectmaterial/updateToview?id="+$("#projectMaterialId").val()+"&directoryId=${directoryId}&projectId=${projectId}&level=${level}";
					// window.location.href ="${basePath}/projectmaterial/updateToview?id="+$("#projectMaterialId").val();
		 		 });
				 
				 $("#butSubmit").click(function() {
				       window.location.href ="${basePath}/projectmaterial/butSubmit?id="+ $("#projectMaterialId").val()+"&directoryId="+$("#directoryId").val()+"&projectId="+${projectId};
			 	  });
				 
				 $("#returnBut").click(function() {
					  // window.location.href='${basePath}/projectmaterial/index?directoryId='+${directoryId};
				/* 	 window.location.href='${basePath}/projectmaterial/index'; */
					 window.location.href="${basePath}/projectmaterial/index?directoryId="+${directoryId}+"&projectId="+${projectId}+"&level="+${level-1};
		 		 });
			});
		</script>
	</form>
</body>
</html>
